# coding:utf-8
import sys
from qfluentwidgets import FluentWindow
from qfluentwidgets import FluentIcon as FIF
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon

from .fileInterface import FileInterface
from ..common import resource


class Window(FluentWindow):

    def __init__(self):
        super().__init__()

        self.file_interface = FileInterface(self)
        self.initNavigation()
        self.initWindow()

    def initNavigation(self):
        self.addSubInterface(self.file_interface, FIF.FOLDER, '文件处理')

    def initWindow(self):
        self.resize(900, 860)
        self.setWindowIcon(QIcon(':/images/images/logo.png'))
        self.setWindowTitle('文件批量改名工具')

        desktop = QApplication.screens()[0].availableGeometry()
        w, h = desktop.width(), desktop.height()
        self.move(w//2 - self.width()//2, h//2 - self.height()//2)
        

def start():
    app = QApplication(sys.argv)
    win = Window()
    win.show()
    app.exec()